<?php $this->_extends('_layouts/blank_layout'); ?>

<?php $this->_block('title'); ?> - 主机管理<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>

	<div id="getting-started">
	    <table>
			<tr><th>主机组名</th><th>描述</th><th>创建时间</th><th>已连接主机数</th><th>总主机数</th><th>操作</th></tr>
			<?php foreach ($group as $s): ?>
			<tr><td><?php if(isset($groupc[$s->id()])){ ?><img src="images/icons/toggle-expand.png" onclick="jQuery('#hostt<?php echo $s->id;?>').toggle();"><?php }?><?php echo $s->groupname;?></td><td><?php echo $s->description;?></td><td><?php echo $s->datetime;?></td><td><?php if(isset($groupc[$s->id()]['lives']))echo $groupc[$s->id()]['lives'];else echo '0';  ?></td><td><?php if(isset($groupc[$s->id()]))echo $groupc[$s->id()]['hosts'];else echo '0';  ?></td><td>
			 <a href="<?php echo url('default::hostmanage/edit', array('group_id' => $s->id())) ?>"><img src="images/icons/edit.png"></a>
				<a href="<?php echo url('default::hostmanage/del', array('group_id' => $s->id())) ?>"><img src="images/icons/del.png"></a>
				<a href="<?php echo url('default::hostlist/state', array('groupid' => $s->id())) ?>"><img src="images/icons/hosts.png"></a></td></tr>
				<tr id="hostt<?php echo $s->id;?>" style="display:none"><td colspan="6">
				<ul id="hostl<?php echo $s->id;?>">
				<?php foreach (Host::nowhost($s->id()) as $ass): ?>
					<li><?php echo $ass->macaddress;?></li>
				<?php endforeach; ?>
				</ul>
				</td></tr>
			<?php endforeach; ?>
			<tr>
				<td colspan="6">
					<center>共有 <font color="Red"><?php echo $pager['record_count'];?></font> 条记录,分为 <font color="Red"><?php echo $pager['page_count'];?></font> 页显示,当前第 <font color="Red"><?php echo $pager['current'];?></font>页,每页 <font color="Red"><?php echo $pager['page_size'];?></font> 条<?php echo $pagestr; ?></center>
				</td>
			</tr>
		</table>
	</div>

<?php $this->_endblock('contents'); ?>